package com.example.lottery.service.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum PrizeTiersEnum {
    FIRST_PRIZE(1,"一等奖"),
    SECOND_PRIZE(2,"二等奖"),
    THIRD_PRIZE(3,"三等奖");
    private final Integer code;
    private final String msg;

    public static PrizeTiersEnum forName(String content){
        //枚举类.values获取所有枚举实例
        for(PrizeTiersEnum prizeTiersEnum:PrizeTiersEnum.values()){
            if(prizeTiersEnum.name().equalsIgnoreCase(content)){
                return prizeTiersEnum;
            }
        }
        return null;
    }
}
